# Read build options (default is ifort-mkl.opt)
PLATFORM ?= archer-gfortran-libsci
include ../build_options/$(PLATFORM).opt

# Lists of things to build
.SUFFIXES:
.SUFFIXES: .f90 .o
OBJS = ../MCMC_utils.o compute.o bench_compute_y.o 
APP = bench_compute_y

# Set of compiler and linker options
FCFLAGS = $(DFLAGS) $(OPTFLAGS) $(OPENMP) $(NETCDFINCLUDE)
LDFLAGS = $(OPTFLAGS) $(OPENMP) $(MATHLIBS) $(NETCDFLIBS)

# Default rule, build the binary
$(APP) : clean $(OBJS)
	$(LD) -o $@ $(OBJS) $(LDFLAGS)

# Remove all build products
clean :
	rm -f ../*.o *.o ../*.mod *.mod $(APP)

# Dependencies
compute.o : ../MCMC_utils.o
bench_compute_y.o : compute.o

# Rule for compiling f90 files
.f90.o:
	$(FC) $(FCFLAGS) -c $< -o $@

